rememberBrowserViewState

@Composable
fun WindowScope.rememberBrowserViewState(browser: Browser, scope: CoroutineScope = rememberCoroutineScope(), dragAndDropOptions: DragAndDropOptions = DragAndDropOptions()): BrowserViewState
@Composable
fun WindowScope.rememberBrowserViewState(browser: Browser, scope: CoroutineScope = rememberCoroutineScope(), dragAndDropOptions: DragAndDropOptions = DragAndDropOptions()): BrowserViewState

Creates a BrowserViewState that is remembered across compositions.

Passing a different browser instance will result in the state being closed and recreated. The state will also be automatically closed when rememberBrowserViewState leaves the composition.

It needs a WindowScope to access the native AWT window. This access enables the BrowserViewState to use native AWT capabilities, such as handling specific window events and accessing window properties.

Since

8.0.0

Parameters

browser

The browser, whose content is to be displayed.

scope

The coroutine scope used for updating Compose observables.

dragAndDropOptions

The configuration options for the drag-and-drop functionality. When using RenderingMode.OFF_SCREEN on all platforms or RenderingMode.HARDWARE_ACCELERATED on macOS, drag-and-drop works only with Compose 1.7.x. In later versions, it’s disabled, and changing this property has no effect. This limitation is due to changes in the Compose API: #416064341.